Building AI agents that can plan and act over longer, more complex tasks
Using an LLM to call tools in a loop is the simplest form of an agent. However, this architecture can yield agents that are "shallow" and fail to plan and act over longer, more complex tasks.
Applications like "Deep Research", "Manus", and "Claude Code" have overcome this limitation by implementing a combination of four key components:
The dominant agent architecture is simple: running in a loop, calling tools. But this leads to "shallow" agents that can't plan over longer time horizons.
Research and coding have emerged as two areas where agents have been created that buck this trend. All major model providers have agents for:
I refer to these agents as "deep agents" - for their ability to dive deep on topics. They are generally capable of planning more complex tasks and executing over longer time horizons.
The core algorithm is the same - an LLM running in a loop calling tools. The difference is:
Long prompts with detailed instructions and examples
Keeps the agent on track with tasks
Allows splitting up tasks for deeper focus
Provides memory and shared workspace
Claude Code's recreated system prompts are long. They contain:
Claude Code is not an anomaly - most of the best coding or deep research agents have pretty complex system prompts. Without these system prompts, the agents would not be nearly as deep. Prompting matters still!
Claude Code uses a Todo list tool. Funnily enough - this doesn't do anything! It's basically a no-op. It's just a context engineering strategy to keep the agent on track.
Deep agents are better at executing on complex tasks over longer time horizons. Planning (even if done via a no-op tool call) is a big component of that.
Claude Code can spawn sub agents. This allows it to split up tasks. You can also create custom sub agents to have more control.
Deep agents go deeper on topics. This is largely accomplished by spinning up sub agents that are specifically focused on individual tasks, and allowing those sub agents to go deep there.
Claude Code has access to the file system and can modify files:
Manus is another example of a deep agent that makes significant use of a file system for "memory".
Deep agents run for long periods and accumulate context. Having a file system to store and later read from is helpful for managing this context.
To make it easier for everyone to build a deep agent for their specific vertical, an open source package (deepagents) was created.
Install with: pip install deepagents
This package provides built-in components:
You can easily create your own deep agent by passing in custom prompts, tools, and subagents.
Start building your own deep agents for your specific vertical today!
TRY OUT `deepagents` HERECheck out the example "deep research" agent built on top of deepagents.